'use strict';
var React = require('react');
var reactDom = require('react-dom/server');
var reactRedux = require('react-redux');
var configureStore = require('../public/javascripts/stores/index.js');
var HkfsCommonDetail = require('../public/javascripts/containers/pc/HkfsCommonDetail.jsx');
var ModelRender = require('./modelRender.jsx');
var Provider = reactRedux.Provider;
const store = configureStore();
var actions=require('../public/javascripts/actions/commonDetail');

exports.RenderFunc = (renderCallBack)=> {

    store.dispatch(actions.receiveDetailContent(''));
    if (renderCallBack) {
        var modelRender = new ModelRender();
        var main = reactDom.renderToString(
            <Provider store={store}>
                <HkfsCommonDetail/>
            </Provider>
        );
        var initializeStore = JSON.stringify(store.getState());
        renderCallBack(modelRender.headerRender(), modelRender.barRender(), modelRender.footerRender(), main, initializeStore);
    }
};